package com.example.lhh.shiro.cashe;

import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheException;
import org.apache.shiro.cache.CacheManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author luoHongHu
 * @Description 自定义redis缓存管理器
 * @date 2025年05月17日 10:59
 */

public class RedisCacheManage implements CacheManager {
    private static final Logger log = LoggerFactory.getLogger(RedisCacheManage.class);

    /**
     *
     * @param cacheName 认证或者授权的缓存键值标识
     * @return
     * @param <K> 键值
     * @param <V> 值
     * @throws CacheException
     */
    @Override
    public <K, V> Cache<K, V> getCache(String cacheName) throws CacheException {
        return new RedisCache<K, V>(cacheName);
    }
}
